
class Person
{
    public int age;
    public String name;
    public String sex;
    public int high;
    public double weight;

    public  void run()
    {
        System.out.println("运动");
    }

    public  void sleep()
    {
        System.out.println("睡觉");
    }
}
public class Test {
    public static void main(String[] args) {

//        Person person1=new Person();
//        Person person2=new Person();
//        person1=person2;
//        代表person1这个引用，指向了，person2这个引用的指向的对象

        //不指向任何对象
        Person person1=null;
        //实例化一个对象
        //用类类型来创建对象的过程，称为实例化对象
        Person person=new Person();
        //通过 对象.属性来进行赋值
        person.age=10;
        person.name="zhangsan";
        person.high=175;
        person.run();
        System.out.println("age:"+person.age+" name:"+person.name);
        System.out.println();
    }


}
